cmake_minimum_required(VERSION 2.8)
PROJECT(WServerEx)

INCLUDE_DIRECTORIES(.)
INCLUDE_DIRECTORIES(/home/game/weiwei/boost_1_51_0)

MESSAGE (PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR})

IF (NOT PROJECT_BINARY_DIR MATCHES build$)
	SET(LIBRARY_OUTPUT_PATH ./build)
	SET(EXECUTABLE_OUTPUT_PATH ./build)
ENDIF (NOT PROJECT_BINARY_DIR MATCHES build$)

SET(CMAKE_CXX_FLAGS "-rdynamic -ldl -lmysqlclient")
SET(CMAKE_C_COMPILER "-g")
SET(CMAKE_BUILD_TYPE Debug)

SET(INCLUDELIST common/timecallback.cpp common/bytearrays.cpp common/env.cpp common/output.cpp common/section.cpp common/msghandle.cpp common/msgclass.cpp common/memorypool.cpp common/msgqueue.cpp common/usertype.cpp)

ADD_EXECUTABLE(wmain WMain/wmain.cpp ${INCLUDELIST})
ADD_LIBRARY(wext SHARED WExt/wext.cpp WExt/wextfunc.cpp WExt/object/wobject.cpp WExt/object/wplayer.cpp WExt/usertype/item.cpp WExt/usertype/task.cpp WExt/usertype/counter.cpp ${INCLUDELIST})

ADD_EXECUTABLE(wmysql WMysql/wmysql.cpp WMysql/wmysqlfunc.cpp ${INCLUDELIST})
ADD_EXECUTABLE(wsocket WSocket/wsocket.cpp ${INCLUDELIST})

